#include "switch_verify.h"
#include "ui_switch_verify.h"
#include "medical.h"
Switch_verify::Switch_verify(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Switch_verify)
{
    ui->setupUi(this);
    QFont font("Microsoft YaHei",12,75);
    QFont font_line("宋体",12,30);

    this->setWindowTitle(tr("切换氧气设备确认界面"));
//####################
//创建一行提示信息
//###################
    //创建一个lable
    Warning_lable=new QLabel(this);
    Warning_lable->setText(QObject::tr("请输入密码以确定切换氧气设备"));
    Warning_lable->setGeometry(15,20,300,30);
    Warning_lable->setAlignment(Qt::AlignJustify|Qt::AlignCenter);
    Warning_lable->setFont(font);

    Passwd_lable=new QLabel(this);
    Passwd_lable->setText(QObject::tr("密码:"));
    Passwd_lable->setGeometry(10,70,50,30);
    Passwd_lable->setAlignment(Qt::AlignJustify|Qt::AlignCenter);
    Passwd_lable->setFont(font);

    passwd_line=new QLineEdit(this);
    passwd_line->setGeometry(90,70,180,30);
    passwd_line->setFont(font_line);

    OK_ptn=new QPushButton(this);
    OK_ptn->setText(QObject::tr("确定"));
    OK_ptn->setGeometry(30,130,100,30);
    cencer_ptn=new QPushButton(this);
    cencer_ptn->setText(QObject::tr("取消"));
    cencer_ptn->setGeometry(180,130,100,30);
    this->setFixedSize(320,200);//设置窗口大小为固定大小
    connect(OK_ptn,&QPushButton::clicked,this,&Switch_verify::OK_ptn_clicked);
    connect(cencer_ptn,&QPushButton::clicked,this,&Switch_verify::cencer_ptn_clicked);
}

Switch_verify::~Switch_verify()
{
    delete ui;
}

void Switch_verify::OK_ptn_clicked()
{
    Medical *M=new Medical();
    M->show();
    this->close();

}

void Switch_verify::cencer_ptn_clicked()
{
    Medical *M=new Medical();
    M->show();
    this->close();
}
